package com.hexacta.hrs.test.data;

import java.util.List;
import java.util.Map;

import org.vectrics.recruiter.document.CandidateDocumentCategory;

/**
 * Test data dependency creator for the CandidateDocumentCategory class.
 * 
 * @author tpollak
 */
public class CandidateDocumentCategoryTestDataDependencyCreator extends AbstractTestDataDependencyCreator {

    public CandidateDocumentCategoryTestDataDependencyCreator(List<TestDataDependencyCreator> dependencies) {
        super(dependencies);
    }

    public void createDependentTestData(Map<String, Object> context) {
        // Create the Candidate Document Categories
        this.createAndInsertCandidateDocumentCategory("resume", "phrase.document.category.resume");
        this.createAndInsertCandidateDocumentCategory("test", "phrase.document.category.aptitude.test");
        this.createAndInsertCandidateDocumentCategory("unknown", "phrase.document.category.unknown");
    }

    private void createAndInsertCandidateDocumentCategory(String code, String description) {
        CandidateDocumentCategory category = this.createCandidateDocumentCategory(code, description);
        this.insertCodedObject(category);
    }

    private CandidateDocumentCategory createCandidateDocumentCategory(String code, String description) {
        CandidateDocumentCategory category = new CandidateDocumentCategory();
        category.setCode(code);
        category.setDescriptionCode(description);
        return category;
    }
}
